package com.music.profile.beans;

import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.music.profile.constants.PlaylistState;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Playlist {
	
	
	public Playlist(Long playlistId, String playlistName, Key createdMemberId,
			PlaylistState state, Long lastAddedSongId, Date creationDate,
			Date lastUpdateDate, List<Key> songsList) {
		this.playlistId = playlistId;
		this.playlistName = playlistName;
		this.createdMemberId = createdMemberId;
		this.state = state;
		this.lastAddedSongId = lastAddedSongId;
		this.creationDate = creationDate;
		this.lastUpdateDate = lastUpdateDate;
		this.songsList = songsList;
	}
	public Date getLastUpdateDate() {
		return lastUpdateDate;
	}
	public void setLastUpdateDate(Date lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long playlistId;
	@Persistent
	private String playlistName;
	@Persistent
	private Key createdMemberId; // Key in the member object
	@Persistent
	private PlaylistState state;
	@Persistent
	private Long lastAddedSongId; // Nullable. So, non key.
	@Persistent
	private Date creationDate;
	@Persistent
	private Date lastUpdateDate;
	@Persistent
	private List<Key> songsList;
	public Long getPlaylistId() {
		return playlistId;
	}
	public void setPlaylistId(Long playlistId) {
		this.playlistId = playlistId;
	}
	public String getPlaylistName() {
		return playlistName;
	}
	public void setPlaylistName(String playlistName) {
		this.playlistName = playlistName;
	}
	public Key getCreatedMemberId() {
		return createdMemberId;
	}
	public void setCreatedMemberId(Key createdMemberId) {
		this.createdMemberId = createdMemberId;
	}
	public PlaylistState getState() {
		return state;
	}
	public void setState(PlaylistState state) {
		this.state = state;
	}
	public Long getLastAddedSongId() {
		return lastAddedSongId;
	}
	public void setLastAddedSongId(Long lastAddedSongId) {
		this.lastAddedSongId = lastAddedSongId;
	}
	public Date getCreationDate() {
		return creationDate;
	}
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}
	
	public void setSongsList(List<Key> songsList) {
		this.songsList = songsList;
	}
	public List<Key> getSongsList() {
		return songsList;
	}
	
	
}
